package com.general.client.validator;

public class StringLengthValidator extends AbstractValidator {
	int maxLength;
	
	public final static int NO_MAXIMUM_LENGTH = -1;
	
	public StringLengthValidator(int maxLength) {
		this.maxLength = maxLength;
	}
	@Override
	public boolean isValid(String validateStr) {
		return maxLength == NO_MAXIMUM_LENGTH ? true : validateStr.length()<=maxLength; 
	}
}
